//485.最大连续1的个数
//https://leetcode.cn/problems/max-consecutive-ones/
class Solution {
public:
    int findMaxConsecutiveOnes(vector<int>& nums) {
        int ret = 0;
        int cnt = 0;
        for(const int& x:nums)
        {
            if(x) ++cnt;
            else
            {
                ret = max(ret,cnt);
                cnt = 0;
            }
        }
        return max(cnt,ret);
    }
};